package com.neusoft.neuiotms.dcam.workflow.converter;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcam.workflow.dto.AnnexDTO;
import com.neusoft.neuiotms.dcam.workflow.model.Annex;

@Component
public class AnnexConverter extends AbstractConverter<Annex, AnnexDTO> {

    @Override
    public Annex toModel(final AnnexDTO dto) {
        final Annex model = new Annex();
        model.setFsId(dto.getFsId());
        model.setName(dto.getName());
        return model;
    }

    @Override
    public AnnexDTO toDTO(final Annex model, final boolean forListView) {
        final AnnexDTO dto = new AnnexDTO();
        dto.setId(model.getId());
        dto.setFsId(model.getFsId());
        dto.setName(model.getName());
        return dto;
    }

}
